# -*- coding: utf-8 -*-
#
# File: Participant.py
#
# Copyright (c) 2009 by ngi644.net
# Generator: ArchGenXML Version 2.4.1
#            http://plone.org/products/archgenxml
#
# GNU General Public License (GPL)
#

__author__ = """Takashi NAGAI <nagai@ngi644.net>"""
__docformat__ = 'plaintext'

from AccessControl import ClassSecurityInfo
from Products.Archetypes.atapi import *
from zope import interface
from zope.interface import implements
import interfaces
from Products.tfcaEvent.interfaces.IParticipant import IParticipant
from Products.ATContentTypes.content.base import ATCTContent

from Products.tfcaEvent.config import *

##code-section module-header #fill in your manual code here
##/code-section module-header

schema = Schema((

    StringField(
        name='userID',
        widget=StringField._properties['widget'](
            label='Userid',
            label_msgid='tfcaEvent_label_userID',
            i18n_domain='tfcaEvent',
        ),
    ),
    DateTimeField(
        name='applyDate',
        widget=DateTimeField._properties['widget'](
            label='Applydate',
            label_msgid='tfcaEvent_label_applyDate',
            i18n_domain='tfcaEvent',
        ),
    ),
    TextField(
        name='comment',
        widget=TextAreaWidget(
            label='Comment',
            label_msgid='tfcaEvent_label_comment',
            i18n_domain='tfcaEvent',
        ),
    ),
    StringField(
        name='attendance_record',
        default='注册',
        widget=SelectionWidget(
            label='Attendance_record',
            label_msgid='tfcaEvent_label_attendance_record',
            i18n_domain='tfcaEvent',
        ),
        vocabulary='getAttendanceType',
    ),

),
)

##code-section after-local-schema #fill in your manual code here
##/code-section after-local-schema

Participant_schema = getattr(ATCTContent, 'schema', Schema(())).copy() + \
    schema.copy()

##code-section after-schema #fill in your manual code here
Participant_schema['title'].widget.visible['edit'] = 'invisible'
Participant_schema['description'].widget.visible['edit'] = 'invisible'
Participant_schema['userID'].widget.visible['edit'] = 'invisible'
Participant_schema['attendance_record'].widget.visible['edit'] = 'invisible'
Participant_schema['comment'].widget.visible['edit'] = 'invisible'
Participant_schema['applyDate'].widget.visible['edit'] = 'invisible'

Participant_schema['subject'].widget.visible['edit'] = 'invisible'
Participant_schema['location'].widget.visible['edit'] = 'invisible'
Participant_schema['language'].widget.visible['edit'] = 'invisible'
Participant_schema['excludeFromNav'].widget.visible['edit'] = 'invisible'
Participant_schema['relatedItems'].widget.visible['edit'] = 'invisible'
Participant_schema['allowDiscussion'].widget.visible['edit'] = 'invisible'
Participant_schema['effectiveDate'].widget.visible['edit'] = 'invisible'
Participant_schema['expirationDate'].widget.visible['edit'] = 'invisible'
Participant_schema['creation_date'].widget.visible['edit'] = 'invisible'
Participant_schema['modification_date'].widget.visible['edit'] = 'invisible'
Participant_schema['creators'].widget.visible['edit'] = 'invisible'
Participant_schema['contributors'].widget.visible['edit'] = 'invisible'
Participant_schema['rights'].widget.visible['edit'] = 'invisible'

##/code-section after-schema

class Participant(ATCTContent):
    """
    """
    security = ClassSecurityInfo()

    implements(interfaces.IParticipant, IParticipant)

    meta_type = 'Participant'
    _at_rename_after_creation = True

    schema = Participant_schema

    ##code-section class-header #fill in your manual code here
    ##/code-section class-header

    # Methods
    def getAttendanceType(self):
        return DisplayList([(str(x),str(x)) for x in atendance_state_list])
    

registerType(Participant, PROJECTNAME)
# end of class Participant

##code-section module-footer #fill in your manual code here
##/code-section module-footer



